#ifndef COMM_HPP
#define COMM_HPP

#include<Arduino.h>

typedef void (*esp_now_recv_cb)(const uint8_t* mac_addr, const uint8_t* data, int data_len);

struct CommEspNow {
	// use you rx buffer, stm is direct print
	static int init(void* buffer, int size, esp_now_recv_cb cb = NULL, Stream* stm = nullptr);
	// wiil be loaded and returned by init
	static void setStartupMode(int val);
	// remove all
	static int clearPeers();
	static int addPeer(int index, uint8_t* address, bool save);
	static void sendStr(const char* msg);
	static int sendStr(int idx, const char* msg);
	static int sendStream(int idx, const void* dat, int len);
	static int receiveStr();
	static void printStatus();

	// not tested.
	static int sendLineByLine(int idx, const char* msgLines, int timeout);
};
#endif